package org.fage.semples.model;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "exam_user_subject")
public class ExamUserSubject implements Serializable {

	private static final long serialVersionUID = 1231352981123564097L;

	@Id
	@ManyToOne(cascade = {CascadeType.DETACH, CascadeType.PERSIST, CascadeType.MERGE})
	@JoinColumn(name = "user_id")
	private ExamUser examUser;
	
	@Id
	@ManyToOne(cascade = {CascadeType.DETACH, CascadeType.PERSIST, CascadeType.MERGE})
	@JoinColumn(name = "sub_id")
	private ExamSubject examSubject;
	
	public ExamUserSubject(){
		super();
	}
	
	public ExamUserSubject(ExamUser examUser, ExamSubject examSubject, String userId, String subId){
		super();
		this.examUser = examUser;
		this.examSubject = examSubject;
	}

	public ExamUser getExamUser() {
		return examUser;
	}

	public void setExamUser(ExamUser examUser) {
		this.examUser = examUser;
	}

	public ExamSubject getExamSubject() {
		return examSubject;
	}

	public void setExamSubject(ExamSubject examSubject) {
		this.examSubject = examSubject;
	}
	
	
}
